
UPDATE FLW_ID_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:22.662') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_ID_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE ACT_APP_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:23.878') WHERE ID = 1 AND LOCKED = 0;

UPDATE ACT_APP_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_FO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:24.367') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_FO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_CO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:24.810') WHERE ID = 1 AND LOCKED = 0;

ALTER TABLE FLW_CO_CONTENT_ITEM ADD FOLDER_PARENT_ID_ VARCHAR(255);

CALL SYSPROC.ADMIN_CMD ('REORG TABLE FLW_CO_CONTENT_ITEM');

CREATE INDEX idx_contitem_folder ON FLW_CO_CONTENT_ITEM(FOLDER_PARENT_ID_);

INSERT INTO FLW_CO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('11', 'flowable', 'com/flowable/content/db/liquibase/flowable-content-db-changelog.xml', CURRENT TIMESTAMP, 11, '7:37593722c93d2f3778a60e07c18a1ba8', 'addColumn tableName=FLW_CO_CONTENT_ITEM; createIndex indexName=idx_contitem_folder, tableName=FLW_CO_CONTENT_ITEM', '', 'EXECUTED', NULL, NULL, '3.5.3', '9768904979');

UPDATE FLW_CO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_AD_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:25.779') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_AD_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_AU_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:26.244') WHERE ID = 1 AND LOCKED = 0;

ALTER TABLE FLW_AUDIT_INSTANCE ADD SUB_SCOPE_ID_ VARCHAR(255);

CALL SYSPROC.ADMIN_CMD ('REORG TABLE FLW_AUDIT_INSTANCE');

INSERT INTO FLW_AU_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('3', 'flowable', 'com/flowable/audit/db/liquibase/flowable-audit-db-changelog.xml', CURRENT TIMESTAMP, 3, '7:8a8e59c3615185ab8448c634c7018abe', 'addColumn tableName=FLW_AUDIT_INSTANCE', '', 'EXECUTED', NULL, NULL, '3.5.3', '9768906400');

UPDATE FLW_AU_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_DO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:27.051') WHERE ID = 1 AND LOCKED = 0;

CREATE TABLE FLW_DO_SCHEMA_DEFINITION (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, KEY_ VARCHAR(128), DEPLOYMENT_ID_ VARCHAR(255) NOT NULL, TENANT_ID_ VARCHAR(64) DEFAULT '', VERSION_ INTEGER, RESOURCE_NAME_ VARCHAR(4000), CREATION_TIME_ TIMESTAMP NOT NULL, CREATOR_ID_ VARCHAR(64), CONSTRAINT PK_DO_SCHEMA_DEFINITIONS PRIMARY KEY (ID_));

ALTER TABLE FLW_DO_SCHEMA_DEFINITION ADD CONSTRAINT FK_DO_SCHEMA_DEF_DEPLOYMENT FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES FLW_DATAOBJECT_DEPLOYMENT (ID_);

CREATE INDEX IDX_DO_SCHEMA_DEF_DEPLOYMENT ON FLW_DO_SCHEMA_DEFINITION(DEPLOYMENT_ID_);

CREATE UNIQUE INDEX FLW_IDX_DO_SCHEMA_DEF_UNIQ ON FLW_DO_SCHEMA_DEFINITION(KEY_, VERSION_, TENANT_ID_);

INSERT INTO FLW_DO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('3', 'flowable', 'com/flowable/dataobject/db/liquibase/flowable-dataobject-db-changelog.xml', CURRENT TIMESTAMP, 3, '7:b91339d61b05e175afccde06b1c97b1b', 'createTable tableName=FLW_DO_SCHEMA_DEFINITION; addForeignKeyConstraint baseTableName=FLW_DO_SCHEMA_DEFINITION, constraintName=FK_DO_SCHEMA_DEF_DEPLOYMENT, referencedTableName=FLW_DATAOBJECT_DEPLOYMENT; createIndex indexName=IDX_DO_SCHEMA_DEF_DEPL...', '', 'EXECUTED', NULL, NULL, '3.5.3', '9768907205');

UPDATE FLW_DO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


CREATE TABLE FLW_PO_DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED SMALLINT NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DBCHGLOGLOCK PRIMARY KEY (ID));

DELETE FROM FLW_PO_DATABASECHANGELOGLOCK;

INSERT INTO FLW_PO_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0);

UPDATE FLW_PO_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:28.044') WHERE ID = 1 AND LOCKED = 0;

CREATE TABLE FLW_PO_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));

CREATE TABLE FLW_POLICY_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_FLW_POLICY_DEP PRIMARY KEY (ID_));

CREATE TABLE FLW_POLICY_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_FLW_POLICY_DEP PRIMARY KEY (ID_));

CREATE TABLE FLW_POLICY_DEFINITION (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, KEY_ VARCHAR(128), DEPLOYMENT_ID_ VARCHAR(255) NOT NULL, TENANT_ID_ VARCHAR(64) DEFAULT '', TYPE_ VARCHAR(128), NAME_ VARCHAR(128), VERSION_ INTEGER, RESOURCE_NAME_ VARCHAR(4000), CREATION_TIME_ TIMESTAMP NOT NULL, CREATOR_ID_ VARCHAR(64), CONSTRAINT PK_POLICY_DEFINITIONS PRIMARY KEY (ID_));

CREATE TABLE FLW_POLICY_DEF_LINK (ID_ VARCHAR(255) NOT NULL, POLICY_DEFINITION_ID_ VARCHAR(255) NOT NULL, TYPE_ VARCHAR(255) NOT NULL, LINK_VALUE_ VARCHAR(255), CONSTRAINT PK_FLW_POLICY_DEF PRIMARY KEY (ID_), CONSTRAINT FK_POLICY_DEF_LINK_POLICY_DEF FOREIGN KEY (POLICY_DEFINITION_ID_) REFERENCES FLW_POLICY_DEFINITION(ID_));

ALTER TABLE FLW_POLICY_DEFINITION ADD CONSTRAINT FK_POLICY_DEF_DEPLOYMENT FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES FLW_POLICY_DEPLOYMENT (ID_);

CREATE INDEX IDX_POLICY_DEF_DEPLOYMENT ON FLW_POLICY_DEFINITION(DEPLOYMENT_ID_);

CREATE UNIQUE INDEX ACT_IDX_POLICIES_DEF_UNIQ ON FLW_POLICY_DEFINITION(KEY_, VERSION_, TENANT_ID_);

CREATE INDEX IDX_POLICY_DEF_LINK_POLICY_DEF ON FLW_POLICY_DEF_LINK(POLICY_DEFINITION_ID_);

INSERT INTO FLW_PO_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'com/flowable/policy/db/liquibase/flowable-policy-db-changelog.xml', CURRENT TIMESTAMP, 1, '7:517b881c6d9e800fdf77621ee32d1351', 'createTable tableName=FLW_POLICY_DEPLOYMENT; createTable tableName=FLW_POLICY_DEPLOYMENT_RESOURCE; createTable tableName=FLW_POLICY_DEFINITION; createTable tableName=FLW_POLICY_DEF_LINK; addForeignKeyConstraint baseTableName=FLW_POLICY_DEFINITION,...', '', 'EXECUTED', NULL, NULL, '3.5.3', '9768908131');

UPDATE FLW_PO_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


CREATE TABLE FLW_SE_DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED SMALLINT NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DBCHGLOGLOCK PRIMARY KEY (ID));

DELETE FROM FLW_SE_DATABASECHANGELOGLOCK;

INSERT INTO FLW_SE_DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0);

UPDATE FLW_SE_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:29.603') WHERE ID = 1 AND LOCKED = 0;

CREATE TABLE FLW_SE_DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));

CREATE TABLE FLW_SE_DEPLOYMENT (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), KEY_ VARCHAR(255), CATEGORY_ VARCHAR(255), DEPLOY_TIME_ TIMESTAMP, TENANT_ID_ VARCHAR(255), PARENT_DEPLOYMENT_ID_ VARCHAR(255), CONSTRAINT PK_FLW_SE_DEPLOYM PRIMARY KEY (ID_));

CREATE TABLE FLW_SE_DEPLOYMENT_RESOURCE (ID_ VARCHAR(255) NOT NULL, NAME_ VARCHAR(255), DEPLOYMENT_ID_ VARCHAR(255), RESOURCE_BYTES_ BLOB, CONSTRAINT PK_FLW_SE_DEPLOYM PRIMARY KEY (ID_));

CREATE TABLE FLW_SE_DEFINITION (ID_ VARCHAR(255) NOT NULL, REV_ INTEGER NOT NULL, KEY_ VARCHAR(128), DEPLOYMENT_ID_ VARCHAR(255) NOT NULL, TENANT_ID_ VARCHAR(64) DEFAULT '', NAME_ VARCHAR(128), VERSION_ INTEGER, RESOURCE_NAME_ VARCHAR(4000), CONSTRAINT PK_SERVICE_DEFINITIONS PRIMARY KEY (ID_));

CREATE UNIQUE INDEX ACT_IDX_SERVICE_DEF_UNIQ ON FLW_SE_DEFINITION(KEY_, VERSION_, TENANT_ID_);

ALTER TABLE FLW_SE_DEFINITION ADD CONSTRAINT FK_SERVICE_DEF_DEPLOYMENT FOREIGN KEY (DEPLOYMENT_ID_) REFERENCES FLW_SE_DEPLOYMENT (ID_);

CREATE INDEX IDX_SERVICE_DEF_DEPLOYMENT ON FLW_SE_DEFINITION(DEPLOYMENT_ID_);

INSERT INTO FLW_SE_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'flowable', 'com/flowable/serviceregistry/db/liquibase/flowable-serviceregistry-db-changelog.xml', CURRENT TIMESTAMP, 1, '7:dc81bb3dba2c4ae9436fb6698d6efdbe', 'createTable tableName=FLW_SE_DEPLOYMENT; createTable tableName=FLW_SE_DEPLOYMENT_RESOURCE; createTable tableName=FLW_SE_DEFINITION; createIndex indexName=ACT_IDX_SERVICE_DEF_UNIQ, tableName=FLW_SE_DEFINITION; addForeignKeyConstraint baseTableName=...', '', 'EXECUTED', NULL, NULL, '3.5.3', '9768909689');

UPDATE FLW_SE_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;


UPDATE FLW_TP_DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '192.168.10.1 (192.168.10.1)', LOCKGRANTED = TIMESTAMP('2019-06-05 23:08:30.889') WHERE ID = 1 AND LOCKED = 0;

UPDATE FLW_TP_DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;

